package com.zircloud.user.app.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zircloud.user.api.UserServiceApi;
import com.zircloud.user.dto.UserDto;



/**
 * 用户控制器
 * @author test
 *
 */
@RestController
@RequestMapping("/v1/users")
public class UserConrtoller {

	
	@DubboReference(version = "1.0.0")
	private UserServiceApi userServiceApi;
	
	/**
	 * 根据ID查询用户
	 * @param id
	 * @return
	 */
	@GetMapping("/details/{id}")
	public UserDto getUserByid(@PathVariable("id")Integer id) {
		UserDto user = userServiceApi.getUserById(id);
		return user;
	}
}
